<!DOCTYPE html>
<html>
  {% extends 'base.html' %}
  {% block title %}
    oec-hardware
  {% endblock %}

  {% block page_content %}
    <table class="table table-striped table-hover">
      <tbody>
        {% for host, id_dict in results.items() %}
          <tr>
            <td>
              <div class="dropdown">
                <div class="dropdown-toggle" data-toggle="dropdown">
                  <p>{{ host }}</p>
                  <span class="caret"></span>
                </div>
                <ul class="dropdown-menu">
                  {% set use_divider = [] %}
                  {% for id, job_list in id_dict.items() %}
                    {% if use_divider %}
                      <li class="divider"></li>
                    {% endif %}

                    <li class="dropdown-content">Test ID: {{ id }}</li>
                    <select onchange="window.location=this.value;">
                      <option value="/results">Please select a job</option>
                      {% for job in job_list %}
                        <option value="/results/{{ host }}/{{ id }}/{{ job }}">{{ job }}</option>
                      {% endfor %}
                    </select>
                  {% endfor %}
                </ul>
              </div>
            </td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  {% endblock %}
</html>
